import Vue from 'vue'

/*
normalize.css:作用：抹平浏览器差异
1:下载安装  yarn add  normalize.css
2:导入
*/
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

// ElementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 语言包
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

// 全局导入scss
// less  scss
import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
import '@/icons' // icon
import '@/permission' // 导航守卫
import directives from '@/directives'
import componentJs from '@/components/lib/index'
import Print from 'vue-print-nb'
import i18n from '@/lang'
import btnControl from '@/mixins/btnControl'
Vue.mixin(btnControl)

Vue.use(Print)
Vue.use(componentJs)

Vue.use(directives, '我是options')
Vue.prototype.$bus = new Vue()

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// 开发环境  npm run serve

// 生产环境  npm run build
// 开发环境输出 a，生产环境输出 b
// process.env.NODE_ENV  1:development生产环境  2:production 生产环境
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: (h) => h(App)
})
